<?php
namespace App\Controllers;

class Friends extends BaseController
{
    public function index()
    {
        // connect to the model
        $Friends = new \App\Models\Friends();
        // retrieve all the records
        $records = $Friends->findAll();
        // get a template parser
        $parser = \Config\Services::parser();
        // tell it about the substitions
        return $parser->setData(['records' => $records])
            // and have it render the template with those
            ->render('Friends');


    }
    public function showme($id)
    {

        // connect to the model
        $Friends = new \App\Models\Friends();
        // retrieve all the records
        $record = $Friends->find($id);
        // get a template parser
        $parser = \Config\Services::parser();
        // tell it about the substitions
        return $parser->setData($record)
            // and have it render the template with those
            ->render('Friends');
    }
}
